const express = require('express');
const router = express.Router();
const logController = require('../controllers/logController');

// 获取所有日志记录
router.get('/logs', logController.getAllLogs);

// 获取特定事件的日志记录
router.get('/logs/event/:eventId', logController.getLogsByEventId);

// 获取单个日志记录
router.get('/logs/:id', logController.getLogById);

// 创建日志记录
router.post('/logs', logController.createLog);

// 删除日志记录
router.delete('/logs/:id', logController.deleteLog);

// 清空特定事件的所有日志
router.delete('/logs/event/:eventId/clear', logController.clearEventLogs);

module.exports = router; 